package com.neu.his.scheduling.serviceImpl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.neu.his.scheduling.entity.DeptUser;
import com.neu.his.scheduling.entity.DeptVo;
import com.neu.his.scheduling.entity.Rule;
import com.neu.his.scheduling.entity.UserRoleVo;
import com.neu.his.scheduling.mapper.SchedulingMapper;
import com.neu.his.scheduling.service.SchedulingService;

@Service
public class SchedulingServiceImpl implements SchedulingService{
	@Autowired
	private SchedulingMapper schedulingMapper;

	@Override
	public List<DeptVo> getDeptList() {
		// TODO Auto-generated method stub
		return schedulingMapper.getDeptList();
	}

	@Override
	public List<UserRoleVo> getUserRole(int deptID) {
		// TODO Auto-generated method stub
		return schedulingMapper.getUserRole(deptID);
	}

	@Override
	public List<UserRoleVo> getAllUserRole() {
		// TODO Auto-generated method stub
		return schedulingMapper.getAllUserRole();
	}

	@Override
	public boolean updateRole(UserRoleVo userRoleVo) {
		// TODO Auto-generated method stub
		int result =schedulingMapper.updateRole(userRoleVo);
		if(result>0) {
			return true;
		}
		return false;
	}

	@Override
	public List<DeptUser> getUserByDeptID(int deptID) {
		// TODO Auto-generated method stub
		return schedulingMapper.getUserByDeptID(deptID);
	}

	@Override
	public boolean addRule(Rule rule) {
		// TODO Auto-generated method stub
		int result=schedulingMapper.addRule(rule);
		if(result>0) {
			return true;
		}
		return false;
	}


		
}
